/**
 * 文档智能摘要工具 - 样式表
 */

/* 基础样式 */
:root {
    /* 亮色主题变量 */
    --primary-color: #4a6baf;
    --primary-dark: #3a5a9f;
    --primary-light: #6a8bcf;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    
    --bg-color: #f8f9fa;
    --surface-color: #ffffff;
    --border-color: #dee2e6;
    --text-color: #212529;
    --text-secondary: #6c757d;
    
    --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
    --shadow: 0 .5rem 1rem rgba(0,0,0,.15);
    --shadow-lg: 0 1rem 3rem rgba(0,0,0,.175);
    
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-lg: 1rem;
    
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-base: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.25rem;
    
    --transition: all 0.3s ease;
}

/* 暗色主题变量 */
.dark-theme {
    --primary-color: #5a7bbf;
    --primary-dark: #4a6baf;
    --primary-light: #7a9bdf;
    
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --border-color: #333333;
    --text-color: #e0e0e0;
    --text-secondary: #aaaaaa;
    
    --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.2);
    --shadow: 0 .5rem 1rem rgba(0,0,0,.3);
    --shadow-lg: 0 1rem 3rem rgba(0,0,0,.4);
}

/* 全局样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: var(--transition);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.5rem;
    font-weight: 500;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

p {
    margin-bottom: 1rem;
}

/* 容器 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 头部 */
header {
    background-color: var(--surface-color);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

header h1 {
    margin: 0;
    font-size: 1.75rem;
    color: var(--primary-color);
}

/* 导航 */
nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav li {
    margin-left: 1.5rem;
}

nav a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

nav a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

nav a.active {
    color: var(--primary-color);
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* 主体内容 */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 140px);
}

/* 页脚 */
footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-secondary);
}

/* 按钮 */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    font-size: var(--font-size-base);
    line-height: 1.5;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
}

.btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(74, 107, 175, 0.25);
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn.primary {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn.primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn.secondary {
    color: #fff;
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn.secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.btn.danger {
    color: #fff;
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn.danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn.small {
    padding: 0.25rem 0.5rem;
    font-size: var(--font-size-sm);
}

/* 表单 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--surface-color);
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(74, 107, 175, 0.25);
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* 开关 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--secondary-color);
    transition: var(--transition);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: var(--transition);
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* 主题切换 */
.theme-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#theme-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* 标签页 */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 输入区域 */
.input-section {
    background-color: var(--surface-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

/* 文件上传 */
.file-upload {
    position: relative;
    margin-bottom: 1rem;
}

.file-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    background-color: var(--bg-color);
    transition: var(--transition);
}

.file-upload-label:hover,
.file-upload-label.dragover {
    border-color: var(--primary-color);
    background-color: rgba(74, 107, 175, 0.05);
}

.file-upload-label .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.file-upload-label .text {
    color: var(--text-secondary);
}

.file-info {
    margin-top: 0.5rem;
}

.file-info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background-color: var(--bg-color);
    border-radius: var(--radius-sm);
}

.file-name {
    font-weight: 500;
    word-break: break-all;
}

.file-size {
    color: var(--text-secondary);
    margin-left: 1rem;
}

/* 结果区域 */
.result-section {
    background-color: var(--surface-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: none;
}

.result-section.show {
    display: block;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.result-actions {
    display: flex;
    gap: 0.5rem;
}

.result-content {
    background-color: var(--bg-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
}

.placeholder {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem 0;
}

/* 关键词标签 */
.keyword-tag {
    display: inline-block;
    background-color: var(--primary-light);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    margin: 0.25rem;
    font-size: var(--font-size-sm);
}

/* 历史记录 */
.history-section {
    background-color: var(--surface-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.search-bar {
    display: flex;
    margin-bottom: 1.5rem;
}

.search-bar input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    background-color: var(--surface-color);
    color: var(--text-color);
}

.search-bar .btn {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.history-item {
    background-color: var(--bg-color);
    border-radius: var(--radius);
    padding: 1rem;
    transition: var(--transition);
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-item-title {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-item-date {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.history-item-summary {
    color: var(--text-color);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.history-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item-info {
    display: flex;
    gap: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--radius-sm);
}

.history-item-actions {
    display: flex;
    gap: 0.5rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.page-info {
    color: var(--text-secondary);
}

/* 设置页面 */
.settings-section {
    background-color: var(--surface-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.settings-group {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.settings-group h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.range-with-value {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--surface-color);
    border-radius: var(--radius);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 130px);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* 通知 */
.notification {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    background-color: var(--surface-color);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    transition: var(--transition);
    transform: translateY(0);
}

.notification.hidden {
    transform: translateY(200%);
}

.notification.info {
    border-left: 4px solid var(--info-color);
}

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.warning {
    border-left: 4px solid var(--warning-color);
}

.notification.error {
    border-left: 4px solid var(--danger-color);
}

.notification .message {
    flex: 1;
}

.notification .close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    transition: var(--transition);
}

.notification .close-btn:hover {
    color: var(--danger-color);
}

/* 加载状态 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: var(--transition);
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--surface-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-overlay p {
    color: white;
    margin: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav li {
        margin: 0 0.75rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .history-item-footer {
        flex-direction: column;
        gap: 1rem;
    }
    
    .history-item-actions {
        width: 100%;
    }
    
    .history-item-actions .btn {
        flex: 1;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    .checkbox-group {
        flex-direction: column;
    }
}